package demo1;

public class Test {
    public static void drawMap(IShape ishape){
        ishape.test();
    }
    public static void main(String[] args) {//三种使用方式
        drawMap(new Shape());
        drawMap(new Rect());
        IShape[] shapes = {new Shape(), new Rect()};
        shapes[0].test();
        shapes[1].test();
        IShape iShape=new Shape();
        iShape.test();
        IShape shape =new Rect();
        shape.test();
    }
}
